home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 732 b | 43 lines | [TEXT/R*ch] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 9, example 5
-
- -- set up XYZ as in the previous example
- module XYZ
- uses ScriptX
- exports x, y, z
- end
- in module XYZ
- global x := 10
- global y := "foo"
- global z := #(56,567)
-
- -- This module uses XYZ, imports only x, and renames it to be
- -- externalX
- module XYZrename1
- uses ScriptX
- uses XYZ with
- renames x:externalX
- end
- end
- in module XYZrename1
- print externalX
- print y
-
- -- now explicitly import x and y, but rename x. rename
- -- overrides import
- module XYZrename2
- uses ScriptX
- uses XYZ with
- imports x, y
- renames x:otherX
- end
- end
- in module XYZrename2
- -- this should generate an exception
- print x
- -- no problem here though
- print otherX
- print y
- -->>>